/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package spidercore;

import GUI.MainWindow;
import Tools.AppDataManager;
import Tools.FileTools;
import Tools.Settings;
import java.io.IOException;
import java.net.URL;
import javax.script.ScriptException;

/**
 *
 * @author Lone_Wolf
 */
public class SpiderCore {
    public static FileTools filetools;
    public static AppDataManager datamanager;
    public static Settings settings;
    public static MainWindow frame;

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws IOException, ScriptException {
        //URL source = new URL("http://www.overclock.net/custom/huddle/overclock/img/header_sprite.v1323371940.png");
        //URL source = new URL("http://cdn.mediafire.com/images/home/cloud-bg.png");
        URL source = new URL("http://uscode.house.gov/download/pls/42C119.txt");
        //URL source = new URL("http://apod.nasa.gov/apod/image/1202/ngc1073_hst_3892.jpg");
        //URL source = new URL("http://apod.nasa.gov/apod/image/1202/redaurora_cherney_1600.jpg");
        //URL source = new URL("http://apod.nasa.gov/apod/image/1202/ngc2237_davis_1663.jpg");
        //URL source = new URL("http://apod.nasa.gov/apod/image/1202/rafael_schmall_lunar_halo_2012_02_02_2.JPG");
        //URL source = new URL("http://apod.nasa.gov/apod/image/1202/oriondeep_andreo_1900.jpg");
        //URL source = new URL("http://apod.nasa.gov/apod/image/1202/CarinaRoad_tafreshi.jpg");
        //https://www.google.ca/images/srpr/logo3w.png
        
        
        // --- REAL BOOT SEQUENCE ---
        
        //loading tools
        filetools = new FileTools();
        datamanager = new AppDataManager();
        
        //loading user settings
        settings = datamanager.loadSettings();
        
        //loading GUI
        frame = new MainWindow();
        frame.setSettings(settings);
        datamanager.setMainWindow(frame);
        frame.setVisible(true);
        
        //loading tasks
        datamanager.loadAllTasks();
    }
}
